package app.texas.com.devilfishhouse.ui;


import app.texas.com.devilfishhouse.R;
import app.texas.com.devilfishhouse.View.Fragment.home.ActionHouseFragment.ActionFragment;
import app.texas.com.devilfishhouse.View.Fragment.home.NearbySeviceFragment;
import app.texas.com.devilfishhouse.View.Fragment.home.SearchLocationFragment;
import app.texas.com.devilfishhouse.View.Fragment.home.didi.DiDiFragment;
import app.texas.com.devilfishhouse.View.Fragment.home.financial.FinancialFragment;
import app.texas.com.devilfishhouse.View.Fragment.home.financial.FinancialProductInfo;
import app.texas.com.devilfishhouse.View.Fragment.home.headline.HeadLineAdapter;
import app.texas.com.devilfishhouse.View.Fragment.home.headline.HeadLineFragment;
import app.texas.com.devilfishhouse.View.Fragment.home.headline.HeadLineInfoFragment;
import app.texas.com.devilfishhouse.View.Fragment.home.myhouse.MyHouseListFragment;
import app.texas.com.devilfishhouse.View.Fragment.houuseList.CostumerSeeHouseFragment;
import app.texas.com.devilfishhouse.View.Fragment.houuseList.HouseInfoFragment;
import app.texas.com.devilfishhouse.View.Fragment.houuseList.NewHouseFragment;
import app.texas.com.devilfishhouse.View.Fragment.houuseList.PlanSeeHouseFragment;
import app.texas.com.devilfishhouse.View.Fragment.mine.TuiGuangFragment;
import app.texas.com.devilfishhouse.View.Fragment.mine.coupon.MyCouponFragemnt;
import app.texas.com.devilfishhouse.View.Fragment.mine.myorder.MyOderFragment;
import app.texas.com.devilfishhouse.View.Fragment.mine.mywallet.MyWalletFragment;
import app.texas.com.devilfishhouse.View.Fragment.mine.setting.SettingFragment;
import app.texas.com.devilfishhouse.View.Fragment.mine.subordinates.MySubordinates;

/**
 * Created by solin on 2017/6/14.
 */

public enum SimpleBackPage {
    NEWHOUSE(1, 0, R.string.newhouse, 0, NewHouseFragment.class, true),
    ERSHOUFANG(1, 0, R.string.ershoufang, 1, NewHouseFragment.class, true),
    FINANCIAL(1, 0, R.string.financlial, 2, FinancialFragment.class, true),
    FINANCIALINFO(1, 0, R.string.financialInfo, 3, FinancialProductInfo.class, true),
    HOUSEINFO(1, 0, R.string.houseinfo, 4, HouseInfoFragment.class, false),
    SEEHOUSE(1, 0, R.string.seehouse, 5, PlanSeeHouseFragment.class, true),
    MYHOUSELIST(1, 0, R.string.myhouselsit, 6, MyHouseListFragment.class, true),
    HOTLINENEWS(1, 0, R.string.hotline, 7, HeadLineFragment.class, true),
    MYWALLET(1, 0, R.string.mywallet, 8, MyWalletFragment.class, true),
    MYORDER(1, 0, R.string.myorder, 9, MyOderFragment.class, true),
    MYSUBORDINATES(1, 0, R.string.mysubordinates, 10, MySubordinates.class, true),
    TUIGUANG(1, 0, R.string.tuiguang, 11, TuiGuangFragment.class, false),
    MYCOUPON(1, 0, R.string.coupon, 12, MyCouponFragemnt.class, true),
    ACTIONFRAGMENT(1, 0, R.string.action, 13, ActionFragment.class, true),
    NEARBYSEVICE(1, 0, R.string.nearbyservice, 14, NearbySeviceFragment.class, true),
    DIDIFRAGMENT(1, 0, R.string.didi, 15, DiDiFragment.class, true),
    HEADLINEINFO(1, 0, R.string.headlineinfo, 16, HeadLineInfoFragment.class, true),
    CUSTOMERSEEHOUSE(1, 0, R.string.costumerSeeHouse, 17, CostumerSeeHouseFragment.class, true),
    SETTING(1, 0, R.string.setting, 18, SettingFragment.class, true),
    SELECTLOCATION(1, 0, R.string.locationname, 19, SearchLocationFragment.class, true);


    private int back;//返回按钮的图片id
    private int icon;//图片的id
    private int title;//标题
    private int value;//代表那个类的序号
    private Class<?> clz;//类名
    private boolean showTitle;//是否显示标题栏

    SimpleBackPage(int back, int icon, int title, int value, Class<?> clz, boolean showTitle) {
        this.back = back;
        this.icon = icon;
        this.title = title;
        this.value = value;
        this.clz = clz;
        this.showTitle = showTitle;
    }

    public int getBack() {
        return back;
    }

    public void setBack(int back) {
        this.back = back;
    }


    public int getIcon() {
        return icon;
    }

    public void setIcon(int icon) {
        this.icon = icon;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public Class<?> getClz() {
        return clz;
    }

    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

    public void setClz(Class<?> clz) {
        this.clz = clz;
    }

    public boolean isShowTitle() {
        return showTitle;
    }

    public void setShowTitle(boolean showTitle) {
        this.showTitle = showTitle;
    }

    public static SimpleBackPage getPageByValue(int value) {
        for (SimpleBackPage p : values()) {
            if (p.getValue() == value) {
                return p;
            }
        }
        return null;
    }

}
